//RenderStates
//Created 04/02/13
//Created By Daniel Bowler
//
//We will be creating all of our render state objects here and provide
//a simple method for each scene to access and use them. 

#pragma once

#include "d3dUtil.h"

class RenderStates
{
public:
	//Init and destroy functions.We will create all our render states
	//when the app loads up allowing each scene to acces
	//them when needed. (We will use this in Chapter 9 and beyond. In this
	//demo, expect to see this system used from scene 13 (blending)
	static void InitAll(ID3D11Device* device);
	static void DestroyAll();
public:
	//Pointers to our render states
	//
	//*********************************
	//********RASTERIZER STATES********
	//*********************************
	//Turns off backface culling.
	static ID3D11RasterizerState* noCullRS;
	//Render in wireframe mode
	static ID3D11RasterizerState* wireframeRS;
	//Render in wireframe mode no culling.
	static ID3D11RasterizerState* wireframeNoCullRS;
	
public:
	//************************************
	//********OUTPUT MERGER STATES********
	//**************BLENDING**************
	//************************************
	//Solid transparant blending state - good for 
	//water and the like. 
	static ID3D11BlendState* transparentBS;
	//Enabled Alpha-To-Coverage (works ONLY when MSAA is enabled)
	static ID3D11BlendState* alphaToCoverageBillboardBS;
	//Additive blending mode.
	static ID3D11BlendState* additiveBlendingBS;
	//Blend state for 2D rendering
	static ID3D11BlendState* trans2DBS;

public:
	//************************************
	//********DEPTH/STENCIL STATES********
	//************************************
	//Modified depth test comparison FROM < TO <= - used in Scene 22 when we render our
	//picked triangle. 
	static ID3D11DepthStencilState* lessEqualDepthTestDSS;
	//Modified depth test comparison from < to == - used after a Z pre pass in our 
	//tile based forward renderer. Also disables depth writes so it should
	//work with transparant objects too!
	static ID3D11DepthStencilState* equalsDepthTestDSS;
	//Depth test is < and no depth writes - used when rendering
	//transparant geometry.
	static ID3D11DepthStencilState* lessThanNoDepthWritesDSS;

private:
	//Init our states
	static void InitRasterizerStates(ID3D11Device* device);
	static void InitBlendStates(ID3D11Device* device);
	static void InitDepthStencilStates(ID3D11Device* device);

private:
	//Disable constructor etc.
	RenderStates();
	RenderStates(const RenderStates& other);
	~RenderStates();
	RenderStates& operator = (const RenderStates& other);
};